package com.codeduck.deploy.controller;

import com.codeduck.deploy.mapper.AccountMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: <a href="mailto:codeduck@163.com">codeduck</a>
 * @date: 2022/11/24
 */
@RestController
public class IndexController {

    @Resource
    private AccountMapper accountMapper;

    @GetMapping("/index")
    public String index() {
        return "hello world";
    }

    @GetMapping("/index/db/test")
    public Object dbTest() {
        return "the result from db: " + accountMapper.countAccountAmount();
    }
}

